﻿using JX.Core.Entity;
using System;
using System.Collections.Generic;
using System.Text;

namespace JX.Dapper
{
	/// <summary>
	/// 接口 用于创建MyDapperDBContext的工厂类，用于实现读写分离
	/// 使用方法：在展示层的Startup.cs文件的ConfigureServices方法中，添加services.AddScoped《IDapperDBContextFactory, DapperDBContextFactory》();
	/// </summary>
	public interface IDapperDBContextFactory
	{
		/// <summary>
		/// 根据枚举，分别创建DapperDBContext
		/// </summary>
		/// <param name="writeAndRead"></param>
		/// <returns></returns>
		public MyDapperDBContext CreateDbContext(WriteAndReadEnum writeAndRead);
	}
}
